package a3;

import java.util.TreeSet;
import java.util.Vector;

public class Predator extends Agent {

	public Predator(Location spawn, Environment env, float alpha, float gamma, float epsilon, String algorithm, float initQ, int ID) {
		super(spawn, env, alpha, gamma, epsilon, algorithm, initQ, ID);
	}	

	@Override
	int getReward(){
		State s = getState();
		TreeSet<Location> locOthers = s.locOthers;
		Location locPrey = s.locPrey;
		
		if (locOthers.contains(new Location(0, 0)) || locOthers.size() < Environment.getPredators().size()-1)
			return -10;
		else if (locOthers.contains(locPrey))
			return 10;
		else if(locPrey.equals(new Location(0, 0)))
			return 10;
			
		return 0;
	}
}
